:root {
    --bg-color: #f0f2f5;
    --sidebar-bg: #ffffff;
    --main-bg: #111827; /* 深色背景 */
    --preview-bg: #1f2937; /* 预览区背景 */
    --border-color: #374151;
    --text-color: #f9fafb;
    --text-secondary: #9ca3af;
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --input-bg: #1f2937;
    --input-text: #d1d5db;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.container { display: flex; width: 100%; height: 100%; }

.sidebar {
    width: 350px;
    flex-shrink: 0;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    color: #111827; /* 侧边栏使用浅色主题文字 */
}

.header { padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid #e5e7eb; }
.header h2 { margin: 0; }
.header p { margin: 4px 0 0; color: #6b7280; }

.form-group { margin-bottom: 20px; }
label { display: block; font-weight: 500; margin-bottom: 8px; }

input[type="password"], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: #f9fafb;
    color: #111827;
    transition: border-color 0.2s;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

#generate-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
}
#generate-btn:hover { background-color: var(--primary-hover); }
#generate-btn:disabled { background-color: #4b5563; cursor: not-allowed; }
#generate-btn .icon { width: 20px; height: 20px; }

.main-content {
    flex-grow: 1;
    background-color: var(--main-bg);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#result-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--preview-bg);
    border-radius: 12px;
    padding: 20px;
}

.placeholder { text-align: center; color: var(--text-secondary); }
.hidden { display: none; }

#video-container {
    width: 100%;
    max-width: 512px; /* 限制最大宽度 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

#result-video {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    background-color: #000;
}

.result-url-container { display: flex; width: 100%; }
#result-url {
    flex-grow: 1;
    background-color: #374151;
    color: #d1d5db;
    border: 1px solid #4b5563;
    border-right: none;
    border-radius: 4px 0 0 4px;
    padding: 8px 12px;
}
#copy-url-btn {
    padding: 8px 16px;
    border-radius: 0 4px 4px 0;
    background-color: #4b5563;
    color: #fff;
    border: 1px solid #4b5563;
    cursor: pointer;
    transition: background-color 0.2s;
}
#copy-url-btn:hover { background-color: #6b7280; }

.spinner {
    border: 5px solid rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s ease infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.error {
    color: #fca5a5;
    background-color: #450a0a;
    border: 1px solid #7f1d1d;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    max-width: 600px;
}

/* --- 进度条样式 --- */
.progress-container {
    width: 80%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.progress-bar-background {
    width: 100%;
    height: 10px;
    background-color: #374151;
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 5px;
    transition: width 0.3s ease-in-out;
}
.progress-text {
    color: var(--text-secondary);
    font-size: 12px;
}
